package com.yingdong.db;

import com.yingdong.annotation.PrimeKey;
import com.yingdong.annotation.AutoIncrease;
import java.util.ArrayList;
import java.util.List;

public class Usermotion extends DBObject{
    
    private static List<Usermotion> delList=new ArrayList<>();
   
	private static Usermotion instance;

    /**
	 * 
	 */
	@PrimeKey
	
    private Integer userId;
    
    /**
	 * 动作类型
	 */
	@PrimeKey
	
    private Integer actionId;
    
    /**
	 * 等级
	 */
	
	
    private Integer level;
    
 

    public Integer getUserId() {
	    return userId;
	}
	
	public void setUserId(Integer userId) {
		this.userId = userId;
		changeDBStatus();
	}

    public Integer getActionId() {
	    return actionId;
	}
	
	public void setActionId(Integer actionId) {
		this.actionId = actionId;
		changeDBStatus();
	}

    public Integer getLevel() {
	    return level;
	}
	
	public void setLevel(Integer level) {
		this.level = level;
		changeDBStatus();
	}
 
 	public static Usermotion getInstance() {
		if (instance == null)
			instance = new Usermotion();
		return instance;
	}
 
    @Override
    public String getSelectByKeyString(){
    	String sql="SELECT * FROM Usermotion WHERE 1=1  AND actionId=?   AND userId=? ";
        return sql;
    }
    
    @Override
    public String getUpdateByKeyString(){
    	String sql="UPDATE  Usermotion SET     level=?    WHERE 1=1   AND actionId=?  AND userId=?";
        return sql;
    }
    
    @Override
    public String getSelectAllObjectsString(){
    	String sql="SELECT * FROM Usermotion ";
        return sql;
    }
    
    @Override
    public String getDelObjectKeyString(){
    	String sql="DELETE  FROM Usermotion WHERE 1=1   AND actionId=?  AND userId=?";
        return sql;
    }
    
    @Override
    public String getSelectAllObjectsKeyString(){
    	String sql="SELECT * FROM Usermotion WHERE 1=1   AND actionId=?  AND userId=?";
        return sql;
    }
    
    
    @Override
	public String getTableName(){
	   return "Usermotion";
	}

}